package Demo603;

import java.sql.SQLException;
import java.util.Scanner;

public class ViewMain {
     public static void main(String[] args) throws SQLException, ClassNotFoundException, SQLException {
         System.out.println("欢迎使用");
         System.out.println( "请选择对应的操作");
         System.out.println( "1.登录");
         System.out.println( "2.注册");
         Scanner scanner = new Scanner(System.in);
         int i = scanner.nextInt();
         switch (i){
             case 1:
                 System.out.println("请输入用户名：");
                 String username = scanner.next();
                 System.out.println("请输入密码:");
                 String password = scanner.next();
                 UserDao userDao = new UserDao();
                 User user = userDao.findUser(username,password);
                 if(user!=null){
                      System.out.println("登录成功");
                 }
                 break;
                 case 2:
                     break;
         }
    }
}
